{% extends "base.html" %}

{% block content %}
<div class="container mt-4">
    <div class="row justify-content-center">
        <div class="col-md-8">
            <div class="card">
                <div class="card-header">
                    <h4 class="card-title mb-0">样本入库</h4>
                </div>
                <div class="card-body">
                    <form method="POST">
                        <div class="mb-3">
                            <label class="form-label">选择仓库</label>
                            <select class="form-select" name="warehouse_id" required>
                                <option value="">请选择仓库</option>
                                {% for warehouse in warehouses %}
                                    {% if warehouse.status == 'normal' %}
                                    <option value="{{ warehouse.id }}">
                                        {{ warehouse.name }} (温度:{{ warehouse.temperature }}°C, 湿度:{{ warehouse.humidity }}%)
                                    </option>
                                    {% endif %}
                                {% endfor %}
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">样本编号</label>
                            <input type="text" class="form-control" name="sample_code" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">样本类型</label>
                            <select class="form-select" name="sample_type" required>
                                <option value="tissue">组织样本</option>
                                <option value="blood">血液样本</option>
                                <option value="dna">DNA样本</option>
                                <option value="rna">RNA样本</option>
                                <option value="protein">蛋白质样本</option>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">数量</label>
                            <input type="number" class="form-control" name="quantity" step="0.01" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">存储位置</label>
                            <input type="text" class="form-control" name="storage_location" 
                                   placeholder="例如: A-01-02 (货架号-层号-位置号)" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">温度要求(°C)</label>
                            <input type="number" class="form-control" name="temperature_requirement" 
                                   step="0.1" required>
                        </div>
                        <div class="mb-3">
                            <label class="form-label">湿度要求(%)</label>
                            <input type="number" class="form-control" name="humidity_requirement" 
                                   step="0.1" required>
                        </div>
                        <div class="d-grid gap-2">
                            <button type="submit" class="btn btn-primary">确认入库</button>
                            <a href="{{ url_for('storage.storage_list') }}" class="btn btn-secondary">返回</a>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 